package com.fit.pianosheetshop.pages;

import java.util.LinkedList;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;


import com.fit.pianosheetshop.beans.WorkmanBean;
import com.fit.pianosheetshop.interfaces.Borrow;
import com.fit.pianosheetshop.interfaces.Workman;
import com.fit.pianosheetshop.service.Workmans;


public class EntryWorkman {
	
	@Property
	@Persist
	private Workman workman;

	@Inject
	private Workmans workmans;

	@SetupRender
	public void createObject() {
		workman = new WorkmanBean();
		workman.setBorrow(new LinkedList<Borrow>());
	}

	void onSuccess() {
		workmans.save(workman);
	}

}
